package com.weibo.survey.domain;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

public class Question implements Serializable {

	private static final long serialVersionUID = -8668650108261472676L;
	private static final String RN = "\r\n";
	private int id;
	private String title;
	// 0,1,2,3 是非矩阵问题 0,2 是不换行的radio/checkbox,1,3是换行的radio/checkbox
	// 4 则是<select/>
	// 5则是<input type='text'/>
	// >6 则是矩阵型
	// 6 表示矩阵内容是radio ,7表示矩阵的内容是checkbox 8表示是select
	private int questionType;
	private String options;
	// 由上面的options拆分而来
	private String[] optionsArr;
	private boolean other;
	// otherStyle==1:是文本输入框，otherStyle==2是下拉列表
	private int otherStyle;
	private String otherSelectOptions;
	// 由上面的otherSelectOptions拆分而来
	private String[] otherSelectOptionsArr;
	private String matrixRowTitles;
	private String[] matrixRowTitleArrs;
	private String matrixColTitles;
	private String[] matrixColTitleArrs;
	private String matrixSelectOptions;
	private String[] matrixSelectOptionArr;
	private Page page;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getQuestionType() {
		return questionType;
	}

	public void setQuestionType(int questionType) {
		this.questionType = questionType;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
		this.optionsArr = StringUtils.split(options, RN);
	}

	public boolean isOther() {
		return other;
	}

	public void setOther(boolean other) {
		this.other = other;
	}

	public int getOtherStyle() {
		return otherStyle;
	}

	public void setOtherStyle(int otherStyle) {
		this.otherStyle = otherStyle;
	}

	public String getOtherSelectOptions() {
		return otherSelectOptions;
	}

	public void setOtherSelectOptions(String otherSelectOptions) {
		this.otherSelectOptions = otherSelectOptions;
		this.otherSelectOptionsArr = StringUtils.split(otherSelectOptions, RN);
	}

	public String getMatrixRowTitles() {
		return matrixRowTitles;
	}

	public void setMatrixRowTitles(String matrixRowTitles) {
		this.matrixRowTitles = matrixRowTitles;
		this.matrixRowTitleArrs = StringUtils.split(matrixRowTitles, RN);
	}

	public String getMatrixColTitles() {
		return matrixColTitles;
	}

	public void setMatrixColTitles(String matrixColTitles) {
		this.matrixColTitles = matrixColTitles;
		this.matrixColTitleArrs = StringUtils.split(matrixColTitles, RN);
	}

	public String getMatrixSelectOptions() {
		return matrixSelectOptions;
	}

	public void setMatrixSelectOptions(String matrixSelectOptions) {
		this.matrixSelectOptions = matrixSelectOptions;
		this.matrixSelectOptionArr = StringUtils.split(matrixSelectOptions, RN);
	}

	public Page getPage() {
		return page;
	}

	public void setPage(Page page) {
		this.page = page;
	}

	public String[] getOptionsArr() {
		return optionsArr;
	}

	public void setOptionsArr(String[] optionsArr) {
		this.optionsArr = optionsArr;
	}

	public String[] getOtherSelectOptionsArr() {
		return otherSelectOptionsArr;
	}

	public void setOtherSelectOptionsArr(String[] otherSelectOptionsArr) {
		this.otherSelectOptionsArr = otherSelectOptionsArr;
	}

	public String[] getMatrixRowTitleArrs() {
		return matrixRowTitleArrs;
	}

	public void setMatrixRowTitleArrs(String[] matrixRowTitleArrs) {
		this.matrixRowTitleArrs = matrixRowTitleArrs;
	}

	public String[] getMaxtrixColTitleArrs() {
		return matrixColTitleArrs;
	}

	public void setMaxtrixColTitleArrs(String[] maxtrixColTitleArrs) {
		this.matrixColTitleArrs = maxtrixColTitleArrs;
	}

	public String[] getMatrixSelectOptionArr() {
		return matrixSelectOptionArr;
	}

	public void setMatrixSelectOptionArr(String[] matrixSelectOptionArr) {
		this.matrixSelectOptionArr = matrixSelectOptionArr;
	}

}
